import request from "@/utils/request.js";

/**
 *  个人消费记录API
 */
export const consumptionRecordPersonalApi = {
    // 根据id和用户名分页查询个人消费记录信息
    page(categoryId, userId, pageNum, pageSize) {
        return request({
            url: `/consumptionRecordPersonal/page`,
            method: 'get',
            params: {
                categoryId,
                userId,
                pageNum,
                pageSize
            }
        })
    },
    // 查询相关类型的全部的个人消费记录信息
    all(categoryId, userId) {
        return request({
            url: `/consumptionRecordPersonal/all`,
            method: 'get',
            params: {
                categoryId,
                userId
            }
        })
    },
    // 添加个人消费记录信息
    append(data) {
        return request({
            url: `/consumptionRecordPersonal/append`,
            method: 'post',
            data: data
        })
    },
    // 从数据库获取每一个分类数据模糊数据
    queryAllBlurData(id) {
        return request({
            url: '/consumptionRecordPersonal/queryAllBlurData',
            method: 'get',
            params: {
                id
            }
        })
    },
    // 修改个人消费记录信息
    update(data) {
        return request({
            url: `/consumptionRecordPersonal/update`,
            method: 'put',
            data: data
        })
    },
    // 删除个人消费记录信息
    remove(id) {
        return request({
            url: `/consumptionRecordPersonal/remove`,
            method: 'delete',
            params: {
                id
            }
        })
    },
    // 条件查询个人消费记录信息
    query(params) {
        return request({
            url: `/consumptionRecordPersonal/query`,
            method: 'get',
            params: {
                ...params
            }
        })
    }
}


